#include<bits/stdc++.h>
#define rep(l,r,i) for(int i=l;i<=r;i++) 
#define per(l,r,i) for(int i=l;i>=r;i--) 
#define pi pair<int,int> 
#define mk make_pair 
using namespace std;
#define Maxn 1000005 
#define int long long 
const int mod = 998244353;
int fsp(int x,int k) {
    int res = 1;
    while(k) {
        if(k&1)res = res*x%mod;
        x = x*x%mod; k >>= 1;
    } return res;
}
int n,k,a[Maxn],ans,cnt,st[Maxn],b[Maxn],vis[Maxn],t[Maxn];
void dfs1(int x) {
    if(x > k) {
        set<int> s;
        rep(1,n,i)s.insert(i),b[i] = a[i];
        rep(1,k,j) {
            int i = st[t[j]];
            auto u = s.find(i);
            if(u == s.begin())return void();
            int p = *u;
            b[*(--u)] -= b[p];
            s.erase(++u);
        }
        for(auto ab:s)ans = (ans+b[ab])%mod;
        cnt = (cnt+1)%mod;
        return void();
    } rep(1,k,i)if(!vis[i])vis[i] = 1,t[x] = i,dfs1(x+1),vis[i] = 0;
}
void dfs(int x,int kc) {
    if(kc == k) {
        dfs1(1);
        return void();
    }
    if(x > n)return void();
    rep(x+1,n,i)st[kc+1] = i,dfs(i,kc+1);
}
signed main()
{
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
    cin>>n>>k;
    rep(1,n,i)cin>>a[i];
    dfs(1,0);
    cout<<ans*fsp(cnt,mod-2)%mod;
    // cout<<"\n"<<cnt;
    return 0;
}
/*
5 2
5 6 7 2 3
*/